package com.wolf.etl.core.database;

import com.wolf.etl.enumeration.DIALECT;

/**
 * @author sdyang
 * @create 2019-04-09 14:22
 **/
public class DataSourceParam {

    private String drive_class_name;

    private String url;

    private String username;

    private String password;

    private DIALECT dialect;

    public DIALECT getDialect() {
        if(url.contains("mysql")){
            return DIALECT.MYSQL;
        }

        if(url.contains("oracle")){
            return DIALECT.ORACLE;
        }

        if(url.contains("sqlserver")){
            return DIALECT.SQLSERVER;
        }
        return DIALECT.UNKNOWN;
    }

    public String getDrive_class_name() {
        return drive_class_name;
    }

    public void setDrive_class_name(String drive_class_name) {
        this.drive_class_name = drive_class_name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
